import {reqAlbum} from "@/http/api";

export default {
    namespaced: true,//开启命名空间
    state: {
        AlbumDetail:{},
        songDetail:[],
        albumId:''
    },
    mutations: {
        GETBANNER(state,data){
            state.AlbumDetail = data.album
            state.songDetail = data.songs;
            state.albumId = state.AlbumDetail.artist.id
            state.AlbumDetail.description = state.AlbumDetail.description.replace(/\n/g,'<br>&emsp;&emsp;');
             }
    },
    actions: {
        async GetAlbum({commit},id) {
            let result = await reqAlbum(id)
            commit('GETBANNER',result.data)
        }
    },
    getters: {

    }
}
